<%

function chkhtm(stra)
	stra=replace(stra,"<","&lt;")
	stra=replace(stra,">","&gt;")
	stra=replace(stra,"'","")
	'stra=replace(stra,"(","（")
	'stra=replace(stra,")","）")
	'stra=replace(stra,";","；")
	'stra=replace(stra,",","，")
	'stra=replace(stra,"%","％")
	'stra=replace(stra,"+","＋")
	chkhtm=stra
end function


function shuJiXiong(SHU)

	if shu="1" then 
		shuJiXiong="<a title='"&shu&":贵人'>"&shu&"</a>"
	elseif shu="2" then 
		shuJiXiong="<a title='"&shu&":病符'>"&shu&"</a>"
	elseif shu="3" then 
		shuJiXiong="<a title='"&shu&":变数和手术伤灾'>"&shu&"</a>"
	elseif shu="4" then 
		shuJiXiong="<a title='"&shu&":破耗'>"&shu&"</a>"
	elseif shu="5" then 
		shuJiXiong="<a title='"&shu&":犯小人或有小聪明'>"&shu&"</a>"
	elseif shu="6" then 
		shuJiXiong="<a title='"&shu&":气索，即生气、受气'>"&shu&"</a>"
	elseif shu="7" then 
		shuJiXiong="<a title='"&shu&":富贵,贵人,急躁'>"&shu&"</a>"
	elseif shu="8" then 
		shuJiXiong="<a title='"&shu&":车灾、伤灾'>"&shu&"</a>"
	elseif shu="9" then 
		shuJiXiong="<a title='"&shu&":变数、手术、辛劳奔波'>"&shu&"</a>"
	elseif shu="10" then 
		shuJiXiong="<a title='"&shu&":受气,是非口舌'>"&shu&"</a>"
	elseif shu="11" then 
		shuJiXiong="<a title='"&shu&":伤灾、手术、冲动'>"&shu&"</a>"
	elseif shu="12" then 
		shuJiXiong="<a title='"&shu&":受气 心慈 忧郁'>"&shu&"</a>"
	end if
	if shuJiXiong="" then shuJiXiong=shu
end function

function shuZiJiXiong(SHU)

	if shu="1" then 
		shuZiJiXiong="贵人."
	elseif shu="2" then 
		shuZiJiXiong="病符."
	elseif shu="3" then 
		shuZiJiXiong="变数和手术伤灾"
	elseif shu="4" then 
		shuZiJiXiong="破耗."
	elseif shu="5" then 
		shuZiJiXiong="犯小人或小聪明."
	elseif shu="6" then 
		shuZiJiXiong="气索.即生气受气."
	elseif shu="7" then 
		shuZiJiXiong="富贵,贵人,急躁."
	elseif shu="8" then 
		shuZiJiXiong="车灾、伤灾"
	elseif shu="9" then 
		shuZiJiXiong="变数、手术、辛劳奔波."
	elseif shu="10" then 
		shuZiJiXiong="受气,是非口舌."
	elseif shu="11" then 
		shuZiJiXiong="伤灾、手术、冲动."
	elseif shu="12" then 
		shuZiJiXiong="受气 心慈 忧郁"
	end if
	if shuZiJiXiong="" then shuZiJiXiong=shu
end function

function dizi(shu)
	if shu="1" then
		dizi="子"
	elseif shu="2" then
		dizi="丑"
	elseif shu="3" then
		dizi="寅"
	elseif shu="4" then
		dizi="卯"
	elseif shu="5" then
		dizi="辰"
	elseif shu="6" then
		dizi="巳"
	elseif shu="7" then
		dizi="午"
	elseif shu="8" then
		dizi="未"
	elseif shu="9" then
		dizi="申"
	elseif shu="10" then
		dizi="酉"
	elseif shu="11" then
		dizi="戌"
	elseif shu="12" then
		dizi="亥"
	end if
end function

function diziFC(shu)
	if shu="子" then
		diziFC="1"
	elseif shu="丑" then
		diziFC="2"
	elseif shu="寅" then
		diziFC="3"
	elseif shu="卯" then
		diziFC="4"
	elseif shu="辰" then
		diziFC="5"
	elseif shu="巳" then
		diziFC="6"
	elseif shu="午" then
		diziFC="7"
	elseif shu="未" then
		diziFC="8"
	elseif shu="申" then
		diziFC="9"
	elseif shu="酉" then
		diziFC="10"
	elseif shu="戌" then
		diziFC="11"
	elseif shu="亥" then
		diziFC="12"
	end if
end function

function TianGanFC(shu)
	if shu="甲" then
		TianGanFC="1"
	elseif shu="乙" then
		TianGanFC="2"
	elseif shu="丙" then
		TianGanFC="3"
	elseif shu="丁" then
		TianGanFC="4"
	elseif shu="戊" then
		TianGanFC="5"
	elseif shu="己" then
		TianGanFC="6"
	elseif shu="庚" then
		TianGanFC="7"
	elseif shu="辛" then
		TianGanFC="8"
	elseif shu="壬" then
		TianGanFC="9"
	elseif shu="癸" then
		TianGanFC="10"
	end if
end function


function  nianGZ(SHU)
	if shu="0" then niangz="甲子"
	if shu="1" then niangz="乙丑"
	if shu="2" then niangz="丙寅"
	if shu="3" then niangz="丁卯"
	if shu="4" then niangz="戊辰"
	if shu="5" then niangz="己巳"
	if shu="6" then niangz="庚午"
	if shu="7" then niangz="辛未"
	if shu="8" then niangz="壬申"
	if shu="9" then niangz="癸酉"
	if shu="10" then niangz="甲戌"
	if shu="11" then niangz="乙亥"
	if shu="12" then niangz="丙子"
	if shu="13" then niangz="丁丑"
	if shu="14" then niangz="戊寅"
	if shu="15" then niangz="己卯"
	if shu="16" then niangz="庚辰"
	if shu="17" then niangz="辛巳"
	if shu="18" then niangz="壬午"
	if shu="19" then niangz="癸未"
	if shu="20" then niangz="甲申"
	if shu="21" then niangz="乙酉"
	if shu="22" then niangz="丙戌"
	if shu="23" then niangz="丁亥"
	if shu="24" then niangz="戊子"
	if shu="25" then niangz="己丑"
	if shu="26" then niangz="庚寅"
	if shu="27" then niangz="辛卯"
	if shu="28" then niangz="壬辰"
	if shu="29" then niangz="癸巳"
	if shu="30" then niangz="甲午"
	if shu="31" then niangz="乙未"
	if shu="32" then niangz="丙申"
	if shu="33" then niangz="丁酉"
	if shu="34" then niangz="戊戌"
	if shu="35" then niangz="己亥"
	if shu="36" then niangz="庚子"
	if shu="37" then niangz="辛丑"
	if shu="38" then niangz="壬寅"
	if shu="39" then niangz="癸卯"
	if shu="40" then niangz="甲辰"
	if shu="41" then niangz="乙巳"
	if shu="42" then niangz="丙午"
	if shu="43" then niangz="丁未"
	if shu="44" then niangz="戊申"
	if shu="45" then niangz="己酉"
	if shu="46" then niangz="庚戌"
	if shu="47" then niangz="辛亥"
	if shu="48" then niangz="壬子"
	if shu="49" then niangz="癸丑"
	if shu="50" then niangz="甲寅"
	if shu="51" then niangz="乙卯"
	if shu="52" then niangz="丙辰"
	if shu="53" then niangz="丁巳"
	if shu="54" then niangz="戊午"
	if shu="55" then niangz="己未"
	if shu="56" then niangz="庚申"
	if shu="57" then niangz="辛酉"
	if shu="58" then niangz="壬戌"
	if shu="59" then niangz="癸亥"
end function

function TianGan(shu)
	if shu="1" then
		TianGan="甲"
	elseif shu="2" then
		TianGan="乙"
	elseif shu="3" then
		TianGan="丙"
	elseif shu="4" then
		TianGan="丁"
	elseif shu="5" then
		TianGan="戊"
	elseif shu="6" then
		TianGan="巳"
	elseif shu="7" then
		TianGan="庚"
	elseif shu="8" then
		TianGan="辛"
	elseif shu="9" then
		TianGan="壬"
	elseif shu="10" then
		TianGan="癸"
	end if
end function


function shengxiao(shu)
	if shu="1" then
		shengxiao="鼠"
	elseif shu="2" then
		shengxiao="牛"
	elseif shu="3" then
		shengxiao="虎"
	elseif shu="4" then
		shengxiao="兔"
	elseif shu="5" then
		shengxiao="龙"
	elseif shu="6" then
		shengxiao="蛇"
	elseif shu="7" then
		shengxiao="马"
	elseif shu="8" then
		shengxiao="羊"
	elseif shu="9" then
		shengxiao="猴"
	elseif shu="10" then
		shengxiao="鸡"
	elseif shu="11" then
		shengxiao="狗"
	elseif shu="12" then
		shengxiao="猪"
	end if
end function


function wuxing(shu)
	if shu="1" then
		wuxing="水"
	elseif shu="2" then
		wuxing="水"
	elseif shu="3" then
		wuxing="土木"
	elseif shu="4" then
		wuxing="木"
	elseif shu="5" then
		wuxing="木"
	elseif shu="6" then
		wuxing="火"
	elseif shu="7" then
		wuxing="火"
	elseif shu="8" then
		wuxing="土"
	elseif shu="9" then
		wuxing="土金"
	elseif shu="10" then
		wuxing="金"
	elseif shu="11" then
		wuxing="金水"
	elseif shu="12" then
		wuxing="水"
	end if
end function

function Zhengwuxing(shu)
	if shu="1" then
		Zhengwuxing="水"
	elseif shu="2" then
		Zhengwuxing="土"
	elseif shu="3" then
		Zhengwuxing="木"
	elseif shu="4" then
		Zhengwuxing="木"
	elseif shu="5" then
		Zhengwuxing="土"
	elseif shu="6" then
		Zhengwuxing="火"
	elseif shu="7" then
		Zhengwuxing="火"
	elseif shu="8" then
		Zhengwuxing="土"
	elseif shu="9" then
		Zhengwuxing="金"
	elseif shu="10" then
		Zhengwuxing="金"
	elseif shu="11" then
		Zhengwuxing="土"
	elseif shu="12" then
		Zhengwuxing="水"
	end if
end function

function XiangChong(nian,yue,ri,shi)
	a=nian&yue&ri&shi
	xiangchong=""
	if instr(a,"子")<>0 and instr(a,"午")<>0 then 
		xiangchong=xiangchong&"子午 "
	end if
	if instr(a,"丑")<>0 and instr(a,"未")<>0 then 
		xiangchong=xiangchong&"丑未 "
	end if
	if instr(a,"寅")<>0 and instr(a,"申")<>0 then 
		xiangchong=xiangchong&"寅申 "
	end if
	if instr(a,"卯")<>0 and instr(a,"酉")<>0 then 
		xiangchong=xiangchong&"卯酉 "
	end if
	if instr(a,"辰")<>0 and instr(a,"戌")<>0 then 
		xiangchong=xiangchong&"辰戌 "
	end if
	if instr(a,"巳")<>0 and instr(a,"亥")<>0 then 
		xiangchong=xiangchong&"巳亥 "
	end if
	if xiangchong="" then xiangchong="无"
end function


function XiangChongDizi(aaa)
	a=nian&yue&ri&shi
	xiangchongdizi=""
		if instr(aaa,"子")<>0 or instr(aaa,"午")<>0 then 
			XiangChongDizi=XiangChongDizi&"子午 "
		end if
		if instr(aaa,"丑")<>0 or instr(aaa,"未")<>0 then 
			XiangChongDizi=XiangChongDizi&"丑未 "
		end if
		if instr(aaa,"寅")<>0 or instr(aaa,"申")<>0 then 
			XiangChongDizi=XiangChongDizi&"寅申 "
		end if
		if instr(aaa,"卯")<>0 or instr(aaa,"酉")<>0 then 
			XiangChongDizi=XiangChongDizi&"卯酉 "
		end if
		if instr(aaa,"辰")<>0 or instr(aaa,"戌")<>0 then 
			XiangChongDizi=XiangChongDizi&"辰戌 "
		end if
		if instr(aaa,"巳")<>0 or instr(aaa,"亥")<>0 then 
			XiangChongDizi=XiangChongDizi&"巳亥 "
		end if
end function

function XiangHaiDizi(aaa)
	a=nian&yue&ri&shi
	XiangHaiDizi=""
		if instr(aaa,"子")<>0 or instr(aaa,"未")<>0 then 
			XiangHaiDizi=XiangHaiDizi&"子未 "
		end if
		if instr(aaa,"丑")<>0 or instr(aaa,"午")<>0 then 
			XiangHaiDizi=XiangHaiDizi&"丑午 "
		end if
		if instr(aaa,"寅")<>0 or instr(aaa,"巳")<>0 then 
			XiangHaiDizi=XiangHaiDizi&"寅巳 "
		end if
		if instr(aaa,"卯")<>0 or instr(aaa,"辰")<>0 then 
			XiangHaiDizi=XiangHaiDizi&"卯辰 "
		end if
		if instr(aaa,"酉")<>0 or instr(aaa,"戌")<>0 then 
			XiangHaiDizi=XiangHaiDizi&"酉戌 "
		end if
		if instr(aaa,"亥")<>0 or instr(aaa,"申")<>0 then 
			XiangHaiDizi=XiangHaiDizi&"亥申 "
		end if
end function


function XiangXingDizi(aaa)
	a=nian&yue&ri&shi
	XiangXingDizi=""
		if instr(aaa,"子")<>0 or instr(aaa,"卯")<>0 then 
			XiangXingDizi=XiangXingDizi&"子卯 "
		end if
		if instr(aaa,"丑")<>0 or instr(aaa,"未")<>0 or instr(aaa,"戌")<>0 then 
			XiangXingDizi=XiangXingDizi&"丑未戌 "
		end if
		if instr(aaa,"寅")<>0 then 
			XiangXingDizi=XiangXingDizi&"寅巳 "
		end if
		if instr(aaa,"辰")<>0  then 
			XiangXingDizi=XiangXingDizi&"辰辰 "
		end if
		if instr(aaa,"巳")<>0  then 
			XiangXingDizi=XiangXingDizi&"寅巳 巳申 "
		end if
		if instr(aaa,"午")<>0 then 
			XiangXingDizi=XiangXingDizi&"午午 "
		end if
		if instr(aaa,"申")<>0 then 
			XiangXingDizi=XiangXingDizi&"巳申 "
		end if
		if instr(aaa,"酉")<>0 then 
			XiangXingDizi=XiangXingDizi&"酉酉 "
		end if		
end function

function XiangXing(nian,yue,ri,shi)
	a=nian&yue&ri&shi
	XiangXing=""
	if instr(a,"子")<>0 and instr(a,"卯")<>0 then
		XiangXing=XiangXing&"子卯 "
	end if
	if instr(a,"丑")<>0 and instr(a,"未")<>0 and instr(a,"戌")<>0  then
		XiangXing=XiangXing&"丑未戌 "
	end if
	if instr(a,"寅")<>0 and instr(a,"巳")<>0 then
		XiangXing=XiangXing&"寅巳 " 
	end if
	if instr(a,"巳")<>0 and instr(a,"申")<>0 then
		XiangXing=XiangXing&"巳申 " 
	end if
	b=replace(a,"丑","")
	b=replace(b,"未","")
	b=replace(b,"戌","")
	b=replace(b,"寅","")
	b=replace(b,"巳","")
	b=replace(b,"申","")
	if instr(b,"辰辰")<>0 then
		XiangXing=XiangXing&"辰辰 "
	end if
	if instr(b,"午午")<>0  then
		XiangXing=XiangXing&"午午 "
	end if
	if instr(b,"酉酉")<>0  then
		XiangXing=XiangXing&"酉酉 "
	end if
	if instr(b,"亥亥")<>0 then
		XiangXing=XiangXing&"亥亥 "
	end if 
	if XiangXing="" then XiangXing="无 "
end function

function ShanHe(nian,yue,ri,shi)
	a=nian&yue&ri&shi
	ShanHe=""
	if instr(a,"子")<>0 and instr(a,"辰")<>0 and instr(a,"申")<>0  then
		ShanHe=ShanHe&"辰子申 "
	end if
	if instr(a,"丑")<>0 and instr(a,"巳")<>0 and instr(a,"酉")<>0  then
		ShanHe=ShanHe&"丑酉巳 "
	end if
	if instr(a,"寅")<>0 and instr(a,"午")<>0 and instr(a,"戌")<>0  then
		ShanHe=ShanHe&"寅午戌 "
	end if
	if instr(a,"卯")<>0 and instr(a,"未")<>0 and instr(a,"亥")<>0  then
		ShanHe=ShanHe&"未卯亥 "
	end if
	if ShanHe="" then ShanHe="无 "
end function


function YIMa(nian,yue,ri,shi)
	a=nian&yue&ri&shi
	YIMa=""
		
		if SHI="申" OR SHI="子" OR SHI="辰" then
			if yue="寅" then 
				YIMa=YIMa&"月上驿马 "
			end if
			if ri="寅" then
				YIMa=YIMa&"日上驿马 "
			end if
			if NIAN="寅" then
				YIMa=YIMa&"年上驿马 "
			end if
		end if
		if SHI="酉" OR SHI="巳" or SHI="丑" then
			if yue="亥" then 
				YIMa=YIMa&"月上驿马 "
			end if
			if ri="亥" then
				YIMa=YIMa&"日上驿马 "
			end if
			if NIAN="亥" then
				YIMa=YIMa&"年上驿马 "
			end if
		end if	
		if SHI="寅" OR SHI="午" or SHI="戌" then
			if yue="申" then 
				YIMa=YIMa&"月上驿马 "
			end if
			if ri="申" then
				YIMa=YIMa&"日上驿马 "
			end if
			if NIAN="申" then
				YIMa=YIMa&"年上驿马 "
			end if
		end if	
		if SHI="卯" OR SHI="亥" or SHI="未" then
			if yue="巳" then 
				YIMa=YIMa&"月上驿马 "
			end if
			if ri="巳" then
				YIMa=YIMa&"日上驿马 "
			end if
			if NIAN="巳" then
				YIMa=YIMa&"年上驿马 "
			end if
		end if	

	if YIMa="" then YIMa="无"
end function




function JiangMa(nian,yue,ri,shi)
	a=nian&yue&ri&shi
	JiangMa=""
		
		if Nian="申" OR NIAN="子" OR nian="辰" then
			if yue="寅" then 
				JiangMa=JiangMa&"月上将马 "
			end if
			if ri="寅" then
				JiangMa=JiangMa&"日上将马 "
			end if
			if SHI="寅" then
				JiangMa=JiangMa&"时上将马 "
			end if
		end if
		if Nian="酉" OR NIAN="巳" or NIAN="丑" then
			if yue="亥" then 
				JiangMa=JiangMa&"月上将马 "
			end if
			if ri="亥" then
				JiangMa=JiangMa&"日上将马 "
			end if
			if SHI="亥" then
				JiangMa=JiangMa&"时上将马 "
			end if
		end if	
		if Nian="寅" OR NIAN="午" or NIAN="戌" then
			if yue="申" then 
				JiangMa=JiangMa&"月上将马 "
			end if
			if ri="申" then
				JiangMa=JiangMa&"日上将马 "
			end if
			if SHI="申" then
				JiangMa=JiangMa&"时上将马 "
			end if
		end if	
		if Nian="卯" OR NIAN="亥" or Nian="未" then
			if yue="巳" then 
				JiangMa=JiangMa&"月上将马 "
			end if
			if ri="巳" then
				JiangMa=JiangMa&"日上将马 "
			end if
			if SHI="巳" then
				JiangMa=JiangMa&"时上将马 "
			end if
		end if	

	if JiangMa="" then JiangMa="无"
end function


function JiangXing(nian,yue,ri,shi)
	a=nian&yue&ri&shi
	JiangXing=""

		if nian="子" or nian="卯" or nian="午" or nian="酉" then
			JiangXing=JiangXing&"年上将星 "
			NianJiangXing="年将星"
		end if
		
		if Nian="辰" OR NIAN="申" then
			if yue="子" then 
				JiangXing=JiangXing&"月上将星 "
				YueJiangXing="月将星"
			end if
			if ri="子" then
				JiangXing=JiangXing&"日上将星 "
				RiJiangXing="日将星"
			end if
			if SHI="子" then
				JiangXing=JiangXing&"时上将星 "
				SHIJiangXing="时将星"
			end if
		end if
		if Nian="丑" OR NIAN="巳" then
			if yue="酉" then 
				JiangXing=JiangXing&"月上将星 "
				YueJiangXing="月将星"
			end if
			if ri="酉" then
				JiangXing=JiangXing&"日上将星 "
				RiJiangXing="日将星"
			end if
			if SHI="酉" then
				JiangXing=JiangXing&"时上将星 "
				SHIJiangXing="时将星"
			end if
		end if	
		if Nian="寅" OR NIAN="戌" then
			if yue="午" then 
				JiangXing=JiangXing&"月上将星 "
				YueJiangXing="月将星"
			end if
			if ri="午" then
				JiangXing=JiangXing&"日上将星 "
				RiJiangXing="日将星"
			end if
			if SHI="午" then
				JiangXing=JiangXing&"时上将星 "
				SHIJiangXing="时将星"
			end if
		end if	
		if Nian="未" OR NIAN="亥" then
			if yue="卯" then 
				JiangXing=JiangXing&"月上将星 "
				YueJiangXing="月将星"
			end if
			if ri="卯" then
				JiangXing=JiangXing&"日上将星 "
				RiJiangXing="日将星"
			end if
			if SHI="卯" then
				JiangXing=JiangXing&"时上将星 "
				SHIJiangXing="时将星"
			end if
		end if	

	if JiangXing="" then JiangXing="无"
end function


function HuaGai(nian,yue,ri,shi)
	a=nian&yue&ri&shi
	HuaGai=""
		if Nian="申" OR NIAN="子" then
			if yue="辰" then 
				HuaGai=HuaGai&"月上华盖 "
			end if
			if ri="辰" then
				HuaGai=HuaGai&"日上华盖 "
			end if
			if SHI="辰" then
				HuaGai=HuaGai&"时上华盖 "
			end if
			
			if dizi(DMDZ)="辰" then
				HuaGai=HuaGai&"大命华盖 "
			end if
		end if
		if Nian="酉" OR NIAN="巳" then
			if yue="丑" then 
				HuaGai=HuaGai&"月上华盖 "
			end if
			if ri="丑" then
				HuaGai=HuaGai&"日上华盖 "
			end if
			if SHI="丑" then
				HuaGai=HuaGai&"时上华盖 "
			end if
			if dizi(DMDZ)="丑" then
				HuaGai=HuaGai&"大命华盖 "
			end if
		end if	
		if Nian="寅" OR NIAN="午" then
			if yue="戌" then 
				HuaGai=HuaGai&"月上华盖 "
			end if
			if ri="戌" then
				HuaGai=HuaGai&"日上华盖 "
			end if
			if SHI="戌" then
				HuaGai=HuaGai&"时上华盖 "
			end if
			if dizi(DMDZ)="戌" then
				HuaGai=HuaGai&"大命华盖 "
			end if
		end if	
		if Nian="卯" OR NIAN="亥" then
			if yue="未" then 
				HuaGai=HuaGai&"月上华盖 "
			end if
			if ri="未" then
				HuaGai=HuaGai&"日上华盖 "
			end if
			if SHI="未" then
				HuaGai=HuaGai&"时上华盖 "
			end if
			if dizi(DMDZ)="未" then
				HuaGai=HuaGai&"大命华盖 "
			end if
		end if	

	if HuaGai="" then HuaGai="无"
end function


function LuHe(nian,yue,ri,shi)
	a=nian&yue&ri&shi
	LuHe=""
	if instr(a,"子")<>0 and instr(a,"丑")<>0 then
		LuHe=LuHe&"子丑 "
	end if
	if instr(a,"寅")<>0 and instr(a,"亥")<>0 then
		LuHe=LuHe&"寅亥 "
	end if
	if instr(a,"卯")<>0 and instr(a,"戌")<>0 then
		LuHe=LuHe&"卯戌 "
	end if
	if instr(a,"辰")<>0 and instr(a,"酉")<>0 then
		LuHe=LuHe&"辰酉 "
	end if
	if instr(a,"巳")<>0 and instr(a,"申")<>0 then
		LuHe=LuHe&"巳申 "
	end if
	if instr(a,"午")<>0 and instr(a,"未")<>0 then
		LuHe=LuHe&"午未 "
	end if
	if LuHe="" then LuHe="无"
end function

function XiangHai(nian,yue,ri,shi)
	a=nian&yue&ri&shi
	XiangHai=""
	if instr(a,"子")<>0 and instr(a,"未")<>0 then
		XiangHai=XiangHai&"子未 "
	end if
	if instr(a,"丑")<>0 and instr(a,"午")<>0 then
		XiangHai=XiangHai&"丑午 "	
	end if
	if instr(a,"寅")<>0 and instr(a,"巳")<>0 then
		XiangHai=XiangHai&"寅巳 "	
	end if
	if instr(a,"卯")<>0 and instr(a,"辰")<>0 then
		XiangHai=XiangHai&"卯辰 "	
	end if
	if instr(a,"亥")<>0 and instr(a,"申")<>0 then
		XiangHai=XiangHai&"亥申 "	
	end if
	if instr(a,"戌")<>0 and instr(a,"酉")<>0 then
		XiangHai=XiangHai&"戌酉 "	
	end if
	if XiangHai="" then XiangHai="无"
end function

function SanSa(nian,yue,ri,shi)
	a=nian&yue&ri&shi
	SanSa=""
	if nian="子" or nian="辰" or nian="申" then
		if yue="巳" then
			SanSa=SanSa&"月上劫煞(巳) "
		end if
		if instr(ri,"巳")<>0 then
			SanSa=SanSa&"日上劫煞(巳) "
		end if
		if shi="巳" then
			SanSa=SanSa&"时上劫煞(巳) "
		end if
		if yue="午" then
			SanSa=SanSa&"月上病煞(午) "
		end if
		if instr(ri,"午")<>0 then
			SanSa=SanSa&"日上病煞(午) "
		end if
		if shi="午" then
			SanSa=SanSa&"时上病煞(午) "
		end if
		if yue="未" then
			SanSa=SanSa&"月上灾煞(未) "
		end if
		if instr(ri,"未")<>0 then
			SanSa=SanSa&"日上灾煞(未) "
		end if
		if shi="未" then
			SanSa=SanSa&"时上灾煞(未) "
		end if
	end if
	
	if nian="丑" or nian="巳" or nian="酉" then
		if yue="寅" then
			SanSa=SanSa&"月上劫煞(寅) "
		end if
		if instr(ri,"寅")<>0 then
			SanSa=SanSa&"日上劫煞(寅) "
		end if
		if shi="寅" then
			SanSa=SanSa&"时上劫煞(寅) "
		end if
		if yue="卯" then
			SanSa=SanSa&"月上病煞(卯) "
		end if
		if instr(ri,"卯")<>0 then
			SanSa=SanSa&"日上病煞(卯) "
		end if
		if shi="卯" then
			SanSa=SanSa&"时上病煞(卯) "
		end if
		if yue="辰" then
			SanSa=SanSa&"月上灾煞(辰) "
		end if
		if instr(ri,"辰")<>0 then
			SanSa=SanSa&"日上灾煞(辰) "
		end if
		if shi="辰" then
			SanSa=SanSa&"时上灾煞(辰) "
		end if
	end if
	
	if nian="寅" or nian="午" or nian="戌" then
		if yue="亥" then
			SanSa=SanSa&"月上劫煞(亥) "
		end if
		if instr(ri,"亥")<>0 then
			SanSa=SanSa&"日上劫煞(亥) "
		end if
		if shi="亥" then
			SanSa=SanSa&"时上劫煞(亥) "
		end if
		if yue="子" then
			SanSa=SanSa&"月上病煞(子) "
		end if
		if instr(ri,"子")<>0 then
			SanSa=SanSa&"日上病煞(子) "
		end if
		if shi="子" then
			SanSa=SanSa&"时上病煞(子) "
		end if
		if yue="丑" then
			SanSa=SanSa&"月上灾煞(丑) "
		end if
		if instr(ri,"丑")<>0 then
			SanSa=SanSa&"日上灾煞(丑) "
		end if
		if shi="丑" then
			SanSa=SanSa&"时上灾煞(丑) "
		end if
	end if
	if nian="亥" or nian="卯" or nian="未" then
		if yue="申" then
			SanSa=SanSa&"月上劫煞(申) "
		end if
		if instr(ri,"申")<>0 then
			SanSa=SanSa&"日上劫煞(申) "
		end if
		if shi="申" then
			SanSa=SanSa&"时上劫煞(申) "
		end if
		if yue="酉" then
			SanSa=SanSa&"月上病煞(酉) "
		end if
		if instr(ri,"酉")<>0 then
			SanSa=SanSa&"日上病煞(酉) "
		end if
		if shi="酉" then
			SanSa=SanSa&"时上病煞(酉) "
		end if
		if yue="戌" then
			SanSa=SanSa&"月上灾煞(戌) "
		end if
		if instr(ri,"戌")<>0 then
			SanSa=SanSa&"日上灾煞(戌) "
		end if
		if shi="戌" then
			SanSa=SanSa&"时上灾煞(戌) "
		end if
	end if
	if SanSa="" then SanSa="无 "
end function

function SanHui(nian,yue,ri,shi)
	a=nian&yue&ri&shi
	SanHui=""
	if instr(a,"亥")<>0 and instr(a,"子")<>0 and instr(a,"丑")<>0  then
		SanHui=SanHui&"亥子丑 "
	elseif instr(a,"寅")<>0 and instr(a,"卯")<>0 and instr(a,"辰")<>0  then
		SanHui=SanHui&"寅卯辰 "
	elseif instr(a,"巳")<>0 and instr(a,"午")<>0 and instr(a,"未")<>0  then
		SanHui=SanHui&"巳午未 "
	elseif instr(a,"申")<>0 and instr(a,"酉")<>0 and instr(a,"戌")<>0  then
		SanHui=SanHui&"申酉戌 "
	end if
	if SanHui="" then SanHui="无"
end function


function TianXing(shu)
	if shu="1" then
		TianXing="<a title='主贵人'>天贵</a> "
	elseif shu="2" then
		TianXing="<a title='主身弱多病'>天病</a> "
	elseif shu="3" then
		TianXing="<a title='主劫变计划和职权'>天权</a> "
	elseif shu="4" then
		TianXing="<a title='主贫穷、破败、分离'>天破</a> "
	elseif shu="5" then
		TianXing="<a title='主小聪明智慧、心灵、预感强、贫贱'>天奸</a> "
	elseif shu="6" then
		TianXing="<a title='主文昌学业、谋略'>天文</a> "
	elseif shu="7" then
		TianXing="<a title='主福贵'>天福</a> "
	elseif shu="8" then
		TianXing="<a title='主辛劳多动,离祖离乡'>天马</a> "
	elseif shu="9" then
		TianXing="<a title='主劫变计划和孤独'>天孤</a> "
	elseif shu="10" then
		TianXing="<a title='主灾伤、惊吓、晦运'>天灾</a> "
	elseif shu="11" then
		TianXing="<a title='主多才多艺、才华'>天艺</a> "
	elseif shu="12" then
		TianXing="<a title='主寿命长，富且贵'>天寿</a> "
	end if
end function

function BuBaMenGua(shu)
	if shu="子" then 
		BuBaMenGua="坎卦-喜阳砂"
	elseif shu="丑" or shu="寅" then
		BuBaMenGua="艮卦-喜阴水"
	elseif shu="卯" then
		BuBaMenGua="震卦-喜阳砂"
	elseif shu="辰" or shu="巳" then
		BuBaMenGua="巽卦-喜阳砂"
	elseif shu="午" then
		BuBaMenGua="离卦-喜阳水"
	elseif shu="未" or shu="申" then
		BuBaMenGua="坤卦-喜阳砂"
	elseif shu="酉" then
		BuBaMenGua="兑卦-喜阳水"
	elseif shu="戌" or shu="亥" then
		BuBaMenGua="乾卦-喜阴水"
	end if
end function


function BuBaMenGua2(shu)
	if shu="1" then
		BuBaMenGua2="坎卦 "
	elseif shu="2" or shu="3" then
		BuBaMenGua2="艮卦 "
	elseif shu="4" then
		BuBaMenGua2="震卦 "
	elseif shu="5" or shu="6" then
		BuBaMenGua2="巽卦 "
	elseif shu="7" then
		BuBaMenGua2="离卦 "
	elseif shu="8" or shu="9" then
		BuBaMenGua2="坤卦 "
	elseif shu="10" then
		BuBaMenGua2="兑卦 "
	elseif shu="11" or shu="12" then
		BuBaMenGua2="乾卦 "
	end if
end function

function GuGuaSa(nian,yue,ri,shi,xb)
	a=nian&yue&ri&shi
	if nian="亥" or nian="子" or nian="丑" then
		if instr(yue,"寅")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"月上孤煞 "
		end if
		if instr(yue,"戌")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"月上寡煞 "
		end if	
		if instr(RI,"寅")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"日上孤煞 "
		end if
		if instr(RI,"戌")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"日上寡煞 "
		end if		
		if instr(shi,"寅")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"时上孤煞 "
		end if
		if instr(shi,"戌")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"时上寡煞 "
		end if	
	end if
	if nian="寅" or nian="卯" or nian="辰" then
		if instr(yue,"巳")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"月上孤煞 "
		end if
		if instr(yue,"丑")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"月上寡煞 "
		end if	
		if instr(RI,"巳")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"日上孤煞 "
		end if
		if instr(RI,"丑")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"日上寡煞 "
		end if	
		if instr(SHI,"巳")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"时上孤煞 "
		end if
		if instr(SHI,"丑")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"时上寡煞 "
		end if				
	end if
	
	if nian="巳" or nian="午" or nian="未" then
		if instr(yue,"申")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"月上孤煞 "
		end if
		if instr(yue,"辰")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"月上寡煞 "
		end if	
		if instr(RI,"申")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"日上孤煞 "
		end if
		if instr(RI,"辰")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"日上寡煞 "
		end if	
		if instr(SHI,"申")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"时上孤煞 "
		end if
		if instr(SHI,"辰")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"时上寡煞 "
		end if				
	end if
	
	if nian="申" or nian="酉" or nian="戌" then
		if instr(yue,"亥")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"月上孤煞 "
		end if
		if instr(yue,"未")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"月上寡煞 "
		end if	
		if instr(RI,"亥")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"日上孤煞 "
		end if
		if instr(RI,"未")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"日上寡煞 "
		end if	
		if instr(SHI,"亥")<>0 and xb="男" then
			GuGuaSa=GuGuaSa&"时上孤煞 "
		end if
		if instr(SHI,"未")<>0 and xb="女" then
			GuGuaSa=GuGuaSa&"时上寡煞 "
		end if				
	end if
	if GuGuaSa="" then GuGuaSa="无"
end function 

function BaiHuSa(nian,yue,ri,shi)
	if instr(nian&yue,"寅")<>0 and instr(nian&yue,"戌")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年月白虎煞</a> "
	if instr(nian&yue,"辰")<>0 and instr(nian&yue,"申")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年月白虎煞</a> "
	if instr(nian&yue,"亥")<>0 and instr(nian&yue,"未")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年月白虎煞</a>  "
	if instr(nian&yue,"巳")<>0 and instr(nian&yue,"丑")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年月白虎煞</a>  "
	
	if instr(nian&shi,"寅")<>0 and instr(nian&shi,"戌")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年时白虎煞</a>  "
	if instr(nian&shi,"辰")<>0 and instr(nian&shi,"申")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年时白虎煞</a>  "
	if instr(nian&shi,"亥")<>0 and instr(nian&shi,"未")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年时白虎煞</a>  "
	if instr(nian&shi,"巳")<>0 and instr(nian&shi,"丑")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年时白虎煞</a>  "

	if instr(yue&shi,"寅")<>0 and instr(yue&shi,"戌")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>月时白虎煞</a>  "
	if instr(yue&shi,"辰")<>0 and instr(yue&shi,"申")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>月时白虎煞</a>  "
	if instr(yue&shi,"亥")<>0 and instr(yue&shi,"未")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>月时白虎煞</a>  "
	if instr(yue&shi,"巳")<>0 and instr(yue&shi,"丑")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>月时白虎煞</a>  "	
	
	if instr(nian&left(ri,1),"寅")<>0 and instr(nian&left(ri,1),"戌")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年日白虎煞</a>  "
	if instr(nian&left(ri,1),"辰")<>0 and instr(nian&left(ri,1),"申")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年日白虎煞</a>  "
	if instr(nian&left(ri,1),"亥")<>0 and instr(nian&left(ri,1),"未")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年日白虎煞</a>  "
	if instr(nian&left(ri,1),"巳")<>0 and instr(nian&left(ri,1),"丑")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>年日白虎煞</a>  "

	if instr(yue&left(ri,1),"寅")<>0 and instr(yue&left(ri,1),"戌")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>月日白虎煞</a>  "
	if instr(yue&left(ri,1),"辰")<>0 and instr(yue&left(ri,1),"申")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>月日白虎煞</a>  "
	if instr(yue&left(ri,1),"亥")<>0 and instr(yue&left(ri,1),"未")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>月日白虎煞</a>  "
	if instr(yue&left(ri,1),"巳")<>0 and instr(yue&left(ri,1),"丑")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>月日白虎煞</a>  "	

	if instr(shi&right(ri,1),"寅")<>0 and instr(shi&right(ri,1),"戌")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>日时白虎煞</a>  "
	if instr(shi&right(ri,1),"辰")<>0 and instr(shi&right(ri,1),"申")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>日时白虎煞</a>  "
	if instr(shi&right(ri,1),"亥")<>0 and instr(shi&right(ri,1),"未")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>日时白虎煞</a>  "
	if instr(shi&right(ri,1),"巳")<>0 and instr(shi&right(ri,1),"丑")<>0 then BaiHuSa=BaiHuSa&"<a title='是断伤灾、病灾，官司、牢狱的一个年支与流年支相比较的推算方法，是以年支起三合支推算的。'>日时白虎煞</a>  "
	
	if BaiHuSa="" then BaiHuSa="无白虎煞 "			
end function

function TianSaGuXing(nian,yue,xb)
	TianSaGuXing=""
	if nian="寅" or nian="午" or nian="戌" then
		if yue="4" and xb="男" then
			TianSaGuXing=TianSaGuXing&"天煞孤星 "
		end if
		if yue="7" and xb="女" then
			TianSaGuXing=TianSaGuXing&"天煞孤星 "
		end if		
	end if
	if nian="申" or nian="子" or nian="辰" then
		if yue="1" and xb="男" then
			TianSaGuXing=TianSaGuXing&"天煞孤星 "
		end if
		if yue="12" and xb="女" then
			TianSaGuXing=TianSaGuXing&"天煞孤星 "
		end if		
	end if
	if nian="亥" or nian="卯" or nian="未" then
		if yue="2" and xb="男" then
			TianSaGuXing=TianSaGuXing&"天煞孤星 "
		end if
		if yue="8" and xb="女" then
			TianSaGuXing=TianSaGuXing&"天煞孤星 "
		end if		
	end if
	if nian="巳" or nian="酉" or nian="丑" then
		if yue="6" and xb="男" then
			TianSaGuXing=TianSaGuXing&"天煞孤星 "
		end if
		if yue="9" and xb="女" then
			TianSaGuXing=TianSaGuXing&"天煞孤星 "
		end if		
	end if
end function

function xiaoerguansa(yue,shi)
	if ( yue="1" or yue="7" ) and ( shi="巳" or shi="亥" ) then 
		xiaoerguansa=xiaoerguansa&"小儿关煞<br>"
	end if
	if ( yue="4" or yue="10" ) and ( shi="寅" or shi="申" ) then 
		xiaoerguansa=xiaoerguansa&"小儿关煞<br>"
	end if
	if ( yue="2" or yue="8" ) and ( shi="辰" or shi="戌" ) then 
		xiaoerguansa=xiaoerguansa&"小儿关煞<br>"
	end if
	if ( yue="11" or yue="5" ) and ( shi="丑" or shi="未" ) then 
		xiaoerguansa=xiaoerguansa&"小儿关煞<br>"
	end if	
	
	if ( yue="3" or yue="9" ) and ( shi="卯" or shi="酉" ) then 
		xiaoerguansa=xiaoerguansa&"小儿关煞<br>"
	end if
	if ( yue="12" or yue="8" ) and ( shi="子" or shi="午" ) then 
		xiaoerguansa=xiaoerguansa&"小儿关煞<br>"
	end if
end function

function QingLongSa(SX,Yue)
	QingLongSa=""
	sx=trim(sx)
	if sx="蛇" and yue="1" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
	if sx="鼠" and yue="2" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
	if sx="牛" and yue="3" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
	if sx="猴" and yue="4" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
	if sx="兔" and yue="5" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
	if sx="狗" and yue="6" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
	if sx="猪" and yue="7" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
	if sx="马" and yue="8" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
	if sx="羊" and yue="9" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
	if sx="虎" and yue="10" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
	if sx="鸡" and yue="11" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
	if sx="龙" and yue="12" then
		QingLongSa=QingLongSa&"<a title='犯青龙煞的人代表多吃国家饭或有工作，不容易失业，但是当不了什么官，男的多外娶，女的多嫁外地或外地人。'>青龙煞</a><br>"
	end if
end function


function LiuNianSanSa(dizia)
	'dizia=dizi(dizia)
	'riaaa=ri mod 12
	'if riaaa=0 then riaaa=12
	if dizia="子" or dizia="辰" or dizia="申" then
		if dizi(nian)="巳" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(年)."
		if dizi(nian)="午" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(年)."
		if dizi(nian)="未" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(年)."
		if dizi(Yue)="巳" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(月)."
		if dizi(Yue)="午" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(月)."
		if dizi(Yue)="未" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(月)."
		if dizi(Yue)="巳" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(月)."
		if dizi(Yue)="午" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(月)."
		if dizi(Yue)="未" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(月)."
		if clng(ri)<=12 then 
			if dizi(Ri)="巳" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)."
			if dizi(Ri)="午" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)."
			if dizi(Ri)="未" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)."
		else
			ria=left(ri,1)
			rib=right(ri,1)
			if dizi(ria)="巳" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)."
			if dizi(ria)="午" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)."
			if dizi(ria)="未" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)."
			if dizi(rib)="巳" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)."
			if dizi(rib)="午" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)."
			if dizi(rib)="未" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)."
		end if
		if dizi(Shi)="巳" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(时)."
		if dizi(Shi)="午" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(时)."
		if dizi(Shi)="未" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(时)."
	end if
	

	if dizia="寅" or dizia="午" or dizia="戌" then
		if dizi(nian)="亥" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(年)."
		if dizi(nian)="子" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(年)."
		if dizi(nian)="丑" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(年)."
		if dizi(Yue)="亥" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(月)."
		if dizi(Yue)="子" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(月)."
		if dizi(Yue)="丑" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(月)."
		if dizi(Yue)="亥" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(月)."
		if dizi(Yue)="子" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(月)."
		if dizi(Yue)="丑" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(月)."
		if clng(ri)<=12 then 
			if dizi(Ri)="亥" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)."
			if dizi(Ri)="子" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)."
			if dizi(Ri)="丑" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)."
		else
			ria=left(ri,1)
			rib=right(ri,1)
			if dizi(ria)="亥" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)."
			if dizi(ria)="子" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)."
			if dizi(ria)="丑" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)."
			if dizi(rib)="亥" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)."
			if dizi(rib)="子" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)."
			if dizi(rib)="丑" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)."
		end if
		if dizi(Shi)="亥" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(时)."
		if dizi(Shi)="子" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(时)."
		if dizi(Shi)="丑" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(时)."
	end if
	
	if dizia="丑" or dizia="酉" or dizia="巳" then
		if dizi(nian)="寅" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(年)."
		if dizi(nian)="卯" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(年)."
		if dizi(nian)="辰" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(年)."
		if dizi(Yue)="寅" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(月)."
		if dizi(Yue)="卯" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(月)."
		if dizi(Yue)="辰" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(月)."
		if dizi(Yue)="宙" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(月)."
		if dizi(Yue)="卯" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(月)."
		if dizi(Yue)="辰" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(月)."
		if clng(ri)<=12 then 
			if dizi(Ri)="寅" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)."
			if dizi(Ri)="卯" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)."
			if dizi(Ri)="辰" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)."
		else
			ria=left(ri,1)
			rib=right(ri,1)
			if dizi(ria)="寅" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)."
			if dizi(ria)="卯" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)."
			if dizi(ria)="辰" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)."
			if dizi(rib)="寅" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)."
			if dizi(rib)="卯" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)."
			if dizi(rib)="辰" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)."
		end if
		if dizi(Shi)="寅" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(时)."
		if dizi(Shi)="卯" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(时)."
		if dizi(Shi)="辰" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(时)."
	end if

	if dizia="亥" or dizia="卯" or dizia="未" then
		if dizi(nian)="申" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(年)."
		if dizi(nian)="酉" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(年)."
		if dizi(nian)="戌" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(年)."
		if dizi(Yue)="申" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(月)."
		if dizi(Yue)="酉" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(月)."
		if dizi(Yue)="戌" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(月)."
		if dizi(Yue)="申" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(月)."
		if dizi(Yue)="酉" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(月)."
		if dizi(Yue)="戌" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(月)."
		if clng(ri)<=12 then 
			if dizi(Ri)="申" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)"
			if dizi(Ri)="酉" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)"
			if dizi(Ri)="戌" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)"
		else
			ria=left(ri,1)
			rib=right(ri,1)
			if dizi(ria)="申" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)"
			if dizi(ria)="酉" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)"
			if dizi(ria)="戌" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)"
			if dizi(rib)="申" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(日)"
			if dizi(rib)="酉" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(日)"
			if dizi(rib)="戌" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(日)"
		end if
		if dizi(Shi)="申" then LiuNianSanSa=LiuNianSanSa & "流年三煞:灾煞(时)"
		if dizi(Shi)="酉" then LiuNianSanSa=LiuNianSanSa & "流年三煞:岁煞(时)"
		if dizi(Shi)="戌" then LiuNianSanSa=LiuNianSanSa & "流年三煞:劫煞(时)"
	end if

end function

%>